<?php
/** @var ContentController $this */
/** @var Page $model */
/** @var Channel $channel */

$channel = $this->getChannel();
$this->pageTitle = '更新 “' . $channel->title . '”';

$this->menu = Channel::model()->getContentMenuItems($channel->id);
?>

<div class="content-dashboard row-fluid">
	<div class="span2">
		<?php
		$this->beginWidget('bootstrap.widgets.TbBox', array(
			'title' => '栏目',
		));
		?>
		<?php
		$items = $channel->getContentMenuItems();
		$this->widget('YJsTreeWidget', array(
			'items' => $items,
			'htmlOptions' => array('class' => 'channel-tree', 'id' => 'channel-tree'),
			'selected' => $channel->id,
			/*
			'options' => array(
				'core' => array(
					'animation' => 0,
					'check_callback' => true,
				),
				'types' => array(

				),
				'plugins' => array("dnd", "types",  "wholerow"),
			)*/
		));
		?>
		<?php $this->endWidget() ?>
	</div>

	<div class="span10">
		<div class="content-render-container" id="content-reader-container">
			<div class="page-header">
				<h1>
					<?php echo $this->pageTitle; ?>
				</h1>
			</div>
			<?php
			Yii::import('bootstrap.widgets.*');
			$form = new TbForm(array(
				'elements' => $model->elements(),
				'buttons' => array(
					'submit' => array(
						'attributes' => array(
							'buttonType' => 'submit',
							'type' => 'primary',
							'label'=>'保存',
						)
					),
				),
			), $model);
			echo $form->render();
			?>
		</div>
	</div>
</div>
